import { lazy } from "react";
import { Navigate } from 'react-router-dom'

import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
const Detail=lazy(()=>import('../promise/Detail'))
const Home=lazy(()=>import('../promise/Home'))
const Login=lazy(()=>import('../promise/Login'))
const MyLayout = lazy(() => import('../promise/MyLayout'))

export const tabbars=[
    {
        path: '/home',
        element: <Home />,
        title: '首页',
        icon:<FriendsO/>
    },
    {
        path: '/detail',
        element: <Detail />,
        title: '详情',
         icon:<FriendsO/>
    },
]

export const routes=[
    {
        path: '/',
        element: <MyLayout />,
        children:[
            ...tabbars,
            {
                path: '/',
                element:<Navigate to='/home'></Navigate>
            }
        ]
    },
    {
        path: '/login',
        element:<Login/>
    }
]